<template>
  <div>
    <!--表格渲染-->
    <el-table class="tl-table" ref="mainTable" :height="200" v-loading="loading" :data="datas" @selection-change="doSelectChange" @sort-change="doSortChange" @row-dblclick="doRowDbClick" @row-click="doRowClick" row-key="id" border fit :row-class-name="doChangeRowClassName">
      <el-table-column type="index" label="序号" width="55px" align="center"></el-table-column>
      <el-table-column prop="milepostname" label="里程碑名称" width="200px" sortable="custom" sort-by="milepostname" align="left" header-align="center" :show-overflow-tooltip="true"></el-table-column>
      <el-table-column prop="planfinishtime" label="计划达成日期" width="140px" sortable="custom" sort-by="planfinishtime" align="center" header-align="center" :show-overflow-tooltip="true" :formatter="dateFormat"></el-table-column>
      <el-table-column prop="actualfinishtime" label="实际完成日期" width="140px" sortable="custom" sort-by="actualfinishtime" align="center" header-align="center" :show-overflow-tooltip="true" :formatter="dateFormat"></el-table-column>
      <el-table-column prop="deliverable" label="交付成果" width="350px" sortable="custom" sort-by="deliverable" align="left" header-align="center" :show-overflow-tooltip="true"></el-table-column>
      <el-table-column prop="completionstatus" label="完成情况" width="350px" sortable="custom" sort-by="completionstatus" align="left" header-align="center" :show-overflow-tooltip="true"></el-table-column>
      <el-table-column prop="differenceanalysis" label="差异分析" width="350px" sortable="custom" sort-by="differenceanalysis" align="left" header-align="center" :show-overflow-tooltip="true"></el-table-column>
      <el-table-column label="操作" min-width="80px" v-slot="scope" fixed="right">
        <el-button icon="el-icon-edit" type="text" @click.native="openEditDialog('editForm', scope.row.id)">编辑</el-button>
      </el-table-column>
    </el-table>
    <tl-edit ref="editForm" @refresh="doRefresh"></tl-edit>
  </div>
</template>

<script>
/** mixins */
import { mixin_list } from '@tapui/mixins/mixin_list'
/** 子组件 */
import tlEdit from './editComp'
import { validateNull } from '@tapui/utils/validate'
/** 工具类 */
import { getAction, putAction, postAction, deleteAction } from '@tapui/utils/http'
export default {
  name: 'sdProjectMilepost',
  mixins: [mixin_list],
  components: { tlEdit },
  data() {
    return {
      description: '项目策划-里程碑-列表查询',
      urlPrefix: '/sd/projectMilepost/',
      url: {
        // queryCodeList: '/sd/projectMilepost/dataCodeList'
        list: '/sd/projectMilepost/list',
        load: '/sd/projectMilepost/load'
      },
      // 排序参数
      sorterInfo: {
        sidx: 'planfinishtime',
        sord: 'asc'
      },
      pageInfo: {
        currentPage: 1, // 当前页面
        pageSize: 1000, // 每页记录数
        pageSizes: ['10', '50', '100'],
        totalCount: 0 // 总数
      },
      isQueryOnCreated: false,
      datas: []
    }
  },
  props: {
    model: {
      default: function() {
        return {}
      },
      type: Object
    }
  },
  methods: {
    beforeLoadData() {
      if (!this.model.projectid) {
        return false
      }
      this.queryParam.qry_projectid = this.model.projectid
      this.queryParam.qry_planapprovalstate = '9'
      this.queryParam.qry_enabled = '1'
      return true
    }
  }
}
</script>
<style scoped></style>

